package com.tianji.learning.controller;

import com.tianji.common.domain.dto.PageDTO;
import com.tianji.learning.domain.query.QuestionAdminPageQuery;
import com.tianji.learning.domain.vo.QuestionAdminVO;
import com.tianji.learning.service.IInteractionQuestionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 小海
 */
@RestController
@RequestMapping("/admin/questions")
@RequiredArgsConstructor
@Api(tags = "互动-问答管理接口")
public class InteractionQuestionAdminController {

    private final IInteractionQuestionService questionService;

    /**
     * 分页查询问题(管理端)
     *
     * @param query
     * @return
     */
    @GetMapping("/page")
    @ApiOperation("分页查询问题(管理端)")
    public PageDTO<QuestionAdminVO> queryQuestionPageAdmin(QuestionAdminPageQuery query) {
        return questionService.queryQuestionPageAdmin(query);
    }
}
